home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3535 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: info.spt.net.cn!usenet
  2. From: txwang@public.sta.net.cn (Wang TianXing)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: who know how to use large array in c++?
  5. Date: Wed, 24 Jan 1996 18:00:03 GMT
  6. Organization: No Organization
  7. Distribution: world
  8. Message-ID: <4e5r4v$41f@info.sta.net.cn>
  9. References: <4e2555$ro6@flood.weeg.uiowa.edu> <4e0ml0$jt5@mercury.wright.edu> <4e2g23$caf@vixen.cso.uiuc.edu>
  10. NNTP-Posting-Host: ts2-10.sta.net.cn
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. sjmccaug@prairienet.org (Scott J. McCaughrin) wrote:
  14.  
  15. | In <4e0ml0$jt5@mercury.wright.edu>, Apichart Intarapanich <aintara> writes:
  16. | >hi
  17. | >anybody know how can i declare array like this
  18. | >
  19. | >float a[1000][1000][1000];
  20. | >
  21. | >i cannot do that. i got segmentation fault statement. who know what should i
  22. | >do?
  23. | >apichart
  24.  
  25. |   Apichart,
  26.  
  27. |  How much memory do you have on your machine? Have you considered 2 vectors,
  28. |  each with 1,000 pointers, to a third vector of floats? The first vector can
  29. |  be considered an array of pointers to vectors of pointers, each pointer in
  30. |  the vector to a vector of 1,000 floats.
  31.  
  32. |  -- Scott McC.
  33.  
  34. Apichart,
  35.  
  36. If your CPU has only 32 or less address lines, you cannot do that,
  37. even with Scott's method.
  38.  
  39. If your CPU has plenty of, say, 48, address lines and your OS supports
  40. them, you can try to config your OS to allow your proccess to have 4GB
  41. or more of memory. If this doesn't work, buy a more expensive system
  42. which can fulfil your needs. :(
  43.  
  44. ---
  45. Wang TianXing
  46.  
  47.  
  48.